package com.rules.admin.controller.decision;


import com.rules.admin.entity.DecisionColumnConfig;
import com.rules.admin.service.decision.DecisionColumnConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping({"/decision-tables/{tableId}/decision-column-configs"})
public class DecisionColumnConfigController {
   @Autowired
   private DecisionColumnConfigService decisionColumnConfigService;

   @RequestMapping(
      method = {RequestMethod.POST}
   )
   @ResponseBody
   public Map<String, Object> createDecisionColumnConfig(@RequestBody DecisionColumnConfig decisionColumnConfig) {
      return null;
   }

   @RequestMapping(
      value = {"/{id}"},
      method = {RequestMethod.DELETE}
   )
   @ResponseBody
   public Map<String, Object> deleteDecisionColumnConfig(@PathVariable Long id) {
      return null;
   }

   @RequestMapping(
      value = {"/{id}"},
      method = {RequestMethod.PUT}
   )
   @ResponseBody
   public Map<String, Object> updateDecisionColumnConfig(@RequestBody DecisionColumnConfig decisionColumnConfig) {
      return null;
   }

   @RequestMapping(
      method = {RequestMethod.GET}
   )
   @ResponseBody
   public List<DecisionColumnConfig> searchDecisionColumnConfigs(@PathVariable Long tableId) {
      return this.decisionColumnConfigService.getColumnConfigsByTableId(tableId);
   }
}
